
package com.amado.springcloud.feignhystrix.controller;

import com.amado.springcloud.feignhystrix.client.UserFeignTwo;
import com.amado.springcloud.user.entity.User;
import com.amado.springcloud.user.fegin.UserFeign;
import com.amado.springcloud.user.vo.SNSResult;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("two")
class HistryxTwoControll {

	@Autowired
	private UserFeignTwo userFeignTwo;

	/**
	 * HystrixCommand当方法发生异常时返回 getDefaultRole方法
	 * @return
	 */
	@GetMapping
	public SNSResult<Void> deleteUser() {
		return userFeignTwo.deleteUser(1L);
	}

}
